<!-- <template>
  <div>
    <vue-qr :logoSrc="logo" :text="qrCodeUrl" :size="150" />
  </div>
</template>

<script>
// import vueQr from 'vue-qr'; // vue2.0
import vueQr from 'vue-qr/src/packages/vue-qr.vue'; // vue3.0 (support vite)
import logo from "@/assets/logo.png"

export default {
  components: { vueQr },
  data() {
    return {
      qrCodeUrl: 'https://blog.csdn.net/AdminGuan', // 二维码的内容
      imageUrl: '@/assets/logo.png' // icon路径
    };
  },
  methods: {}
};
</script>
 -->




<template>
  <div>
    <vue-qr :logoSrc="logo" :text="qrCodeUrl" :size="150" />
  </div>
</template>

<script setup lang="ts">
// import vueQr from 'vue-qr'; // vue2.0
import vueQr from 'vue-qr/src/packages/vue-qr.vue'; // vue3.0 (support vite)
import logo from "@/assets/logo.png"
import { ref } from "vue";

const qrCodeUrl = ref('http://bestwishes0203.github.io/blog/') // 二维码的内容

// const getAssetsFile = (url: string) => {
//   return new URL(`../assets/images/${url}`, import.meta.url).href
// }
</script>



<!--  ERROR TypeError: Cannot read properties of undefined (reading '_android') -->
<!-- <template>
  <div>
  </div>
</template>
 
<script setup lang="ts">
import QRCode from 'qrcodejs2';
import { onMounted } from "vue"

onMounted(() => {

})

const creatQrCode = () => {
  new QRCode('qrCodeUrl', {
    text: 'https://blog.csdn.net/AdminGuan', // 二维码的内容
    width: 150,
    height: 150,
    colorDark: '#000',
    colorLight: '#fff'
  });
}
</script> -->